export default {
  route: '/project/template/form/advanced',
  title: '组合区块',
  local: {},
  remote: {},
  elementConfig: {
    type: 'HtGuiContainer',
    props: {},
    children: [
      {
        type: 'HtCard',
        props: {
          title: '组合区块',
          extra: [
            {
              type: 'HtButton',
              props: {
                type: 'link',
                text: '跳转页面',
                href: '/',
                useH5Href: false,
                linkTarget: false,
              },
              children: [],
            },
          ],
          type: 'HtCard',
          bordered: true,
        },
        children: [
          {
            type: 'HtList',
            props: {
              url: '/mock/api/list',
              pageSize: 2,
              columns: [
                {
                  title: 'id',
                  dataIndex: 'id',
                  width: 50,
                  tooltip: '你好',
                },
                {
                  title: 'banner',
                  dataIndex: 'imageUrl',
                  width: 60,
                  renderType: 'img',
                  sort: true,
                },
                {
                  title: '预览链接',
                  dataIndex: 'preview',
                  width: 80,
                  renderType: 'a',
                },
                {
                  title: '标签',
                  dataIndex: 'tags',
                  renderType: 'tag',
                  width: 100,
                  isWrapper: true,
                },
                {
                  title: '开关',
                  dataIndex: 'switch',
                  renderType: 'switch',
                  url: '/mock/api/update',
                  width: 100,
                },
              ],
              extra: [
                {
                  type: 'HtModalForm',
                  props: {
                    url: '/mock/api/update',
                    fields: [
                      {
                        field: 'name',
                        title: '姓名',
                      },
                      {
                        field: 'age',
                        title: '年龄',
                        type: 'InputNumber',
                      },
                    ],
                    title: '弹框表单',
                    triggerButtonText: '点我',
                    buttonType: 'primary',
                    width: 416,
                    top: 100,
                    method: 'post',
                    cols: 1,
                    alias: '$$HtModalForm',
                    buttons: ['cancel', 'submit'],
                    transform: '<%:= data => ({ ...data }) %>',
                  },
                },
              ],
              uniqueKey: 'id',
              cols: 3,
              isAutoSubmit: true,
              columnsSetting: true,
              isPagination: true,
              pageSizeOptions: ['10', '20', '50', '100', '500', '1000'],
              method: 'get',
              alias: '$$HtList',
              buttons: ['back', 'submit'],
              cardType: 'default',
              transform: '<%:= data => ({ ...data }) %>',
              fieldMap: {
                pageNumKey: 'pageNum',
                pageSizeKey: 'pageSize',
                listKey: 'list',
                totalKey: 'total',
              },
              type: 'HtList',
              title: '区块1',
            },
            children: [],
          },
          {
            type: 'HtDivider',
            props: {
              type: 'horizontal',
              title: '分割线',
              orientation: 'center',
            },
            children: [],
          },
          {
            type: 'HtForm',
            props: {
              title: '区块2',
              isCard: true,
              url: '/mock/api/update',
              fields: [
                {
                  field: 'name',
                  title: '姓名',
                  disabled: false,
                  tooltip: '',
                  required: false,
                  placeholder: '',
                  type: 'Input',
                  defaultValue: '',
                },
                {
                  field: 'sex',
                  title: '性别',
                  disabled: false,
                  tooltip: '',
                  required: false,
                  placeholder: '',
                  options: [
                    {
                      label: '男',
                      value: '1',
                    },
                    {
                      label: '女',
                      value: '0',
                    },
                  ],
                  defaultValue: '1',
                  type: 'Radio',
                },
                {
                  'v-if': '<%:= true %>',
                  field: 'remark',
                  title: '密码',
                  disabled: false,
                  tooltip: '',
                  required: false,
                  placeholder: '',
                  defaultValue: '',
                  type: 'Input.Password',
                  onChangeRequests: [
                    {
                      event: 'onChange',
                      method: 'get',
                      params: {},
                      transform: '<%:= v => v %>',
                    },
                  ],
                },
                {
                  title: '',
                  type: 'Divider',
                },
                {
                  title: '',
                  type: 'Divider',
                },
                {
                  'v-if': '<%:= true %>',
                  field: 'age',
                  title: '计数器',
                  disabled: false,
                  tooltip: '',
                  required: false,
                  placeholder: '',
                  type: 'InputNumber',
                },
                {
                  field: 'season',
                  title: '登场季数',
                  disabled: false,
                  tooltip: '',
                  required: false,
                  placeholder: '',
                  defaultValue: 1,
                  type: 'InputNumber',
                },
                {
                  field: 'remark',
                  title: '人物介绍',
                  disabled: false,
                  tooltip: '',
                  required: false,
                  placeholder: '',
                  type: 'Input.TextArea',
                  rows: 4,
                  defaultValue: '',
                },
                {
                  title: '',
                  type: 'Divider',
                },
              ],
              alias: '$$HtForm',
              type: 'HtForm',
              labelCol: {
                span: 5,
                offset: 0,
              },
              wrapperCol: {
                span: 15,
                offset: 0,
              },
              method: 'post',
              cols: 1,
              responseAlias: '$$HtFormResponse',
              buttons: ['reset', 'submit'],
              transform: '<%:= data => ({ ...data }) %>',
            },
          },
        ],
      },
    ],
  },
}
